import request from '@/utils/request'
// 订单确认
export const checkOrder = (mode, obj) => {
  return request.get('/checkout/order', {
    params: {
      mode, // cart buyNow
      delivery: 10, // 10 快递配送 20门店自提
      couponId: 0, // 不使用优惠卷
      isUserPoints: 0,
      ...obj // 将传过来的参数对象动态展开
    }
  })
}

export const submitOrder = (mode, obj) => {
  return request.post('/checkout/submit', {
    mode,
    delivery: 10, // 快递配送
    couponId: 0,
    isUserPoints: 0,
    payType: 10, // 余额支付
    ...obj
  })
}
